from Base.Base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    # 定位器
    # 请登录元素
    pleace_login_loc  = (By.XPATH,'/html/body/div[2]/div/div[1]/div/a[1]')
    # 账号定位元素
    username_loc = (By.ID,'userName')
    # 密码定位元素
    password_loc = (By.NAME,'_pwd')
    # 登录按钮定位元素
    login_btn_loc = (By.ID,'save')
    # 确定
    sure_loc = (By.ID,'bindSub')


    # 封装定位元素方法
    # 点击请登录
    def pleace_login(self):
        self.click(self.pleace_login_loc)
    # 输入账号
    def username(self):
        self.send_keys(self.username_loc,'18238680385')
    # 输入密码
    def password(self):
        self.send_keys(self.password_loc,'123456Aa')
    # 点击登录按钮
    def login_btn(self):
        self.click(self.login_btn_loc)
    # 点击确认
    def sure(self):
        self.click(self.sure_loc)


